package org.millioncall.yueyoga.admin.dao;

import java.util.List;
import java.util.Map;

import org.millioncall.yueyoga.admin.model.Reservation;
import org.millioncall.yueyoga.admin.model.WeeklyUseTimes;

public interface ReservationDAO {
	// 查询会员周使用情况
	public WeeklyUseTimes getMemberWeeklyUseTimes(Integer memberId);

	// 设定会员某产品的周使用次数
	public void setProductWeeklyUseTimes(Map<String, Object> params);

	public Reservation findReservationByScheduleId(Integer id);

	public int update(Reservation reservation);

	public int saveReservation(Reservation reservation);

	public List<Reservation> findReservationByMap(Map<String, Object> maps);

	public List<Reservation> findReservationByCdts(Map<String, Object> map);

	public boolean delReservationsByScheduleId(String scheduleId);

	public boolean updateByReservation(Reservation reservation);

	/**
	 * 更具Id查询座位信息
	 * 
	 * @param id
	 * @return Reservation
	 */
	public Reservation findReservationById(Integer id);

	public boolean cancelReservation(Integer reservateId);

	/**
	 * 查询下一个预约编号
	 * 
	 * @return
	 */
	public Integer findNextResvId(Integer scheduleId);

	/**
	 * 根据课程编号和会员编号查询是否预约
	 * 
	 * @param scheId
	 * @param memberId
	 * @return
	 */
	public int findResvCountByScheIdAndMemberId(String scheId, String memberId);

	/**
	 * 根据课程编号和会员编号查询预约信息
	 * 
	 * @param scheId
	 * @param memberId
	 * @return
	 */
	public Reservation findResvScheduleInfoByScheIdAndMemberId(String scheId,
			String memberId);

	/**
	 * 取消预订
	 * 
	 * @param map
	 *            参数集合
	 * */
	public int cancelReserve(Map<String, Object> map);
}
